package com.kjtpay.design_pattern.chain;

/**
 * 普通经理；ConcreteHandler
 */
class CommonManager extends Manager {
    public CommonManager(String name) {
        super(name);
    }

    @Override
    public void requestApplication(Request request) {
        if (("请假" == request.type) && (request.number <= 2)) {
            log = name + ":" + request.content + ",数量："
                    + request.number + " === 被批准" + "\n";
        } else {
            log = name + ":" + request.content + ",数量："
                    + request.number + " === 我无权处理" + "\n";
            // 转发给上级
            if (null != superior) {
                superior.requestApplication(request);
            }
        }
    }
}
